<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
?>

<!-- JavaScript -->
<script type="text/javascript" src="<?php echo base_url() ?>js/wufoo.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>js/zebra_datepicker.js"></script>

<!-- CSS -->
<link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>css/form/form.css" media="screen, tv, projection" title="Default" />
<link rel="stylesheet" href="<?php echo base_url() ?>css/zebra_datepicker_metallic.css" type="text/css">
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>css/chosen.css" media="screen, tv, projection" title="Default" />


<div id="container">
	<?php
    //Setting Awal Value Jika Prosedur yang dilakukan adalah prosedur input biasa.
	$value = array(
		'legend'			=> "Form Rekapitulasi Data",
		'act_form'			=> "data_rekap"
	);
	
	?>
	<?php echo form_open_multipart($value["act_form"],'class="wufoo" name="menu_rekap"'); ?>
	<fieldset class="fieldset">
	<legend class="legend">
		<?= $value["legend"] ?> |
	</legend>
	
	<div class="separator">
	</div>
	
 <!-- Konten -------------------------------------------------------------------------->
 <div id="contentform">
 <?php $atrib='style="width:250px"; class="chzn-select field"'?> 
 <?php $atrib_jenis_laporan='style="width:250px;" id="jenis_laporan" class="chzn-select field"'?>
 <?php $atrib_bulan='style="width:250px;" id="bulan" class="chzn-select field"'?>
 <?php $atrib_divisi='style="width:250px;" id="divisi" class="chzn-select field"'?>

	<ul>
        <li>
            <label class="desc">Tipe Laporan *</label>
                <div>
                    <?php	echo form_dropdown('jenis_laporan', $jenis_laporan_options, set_value('jenis_laporan'),$atrib_jenis_laporan); ?>
                </div>
            <?php echo form_error('jenis_laporan'); ?>
        </li>

		<li>
            <label class="desc">Tahun *</label>
            <div>
                <?php
                    //list tahun
                    if(function_exists("date_default_timezone_set") and function_exists("date_default_timezone_get"))
                    @date_default_timezone_set(@date_default_timezone_get());
                               
					$options['all'] = "-- Pilih Tahun --";
					for($thn=2012;$thn<=date("Y")+5;$thn++)
					{
						$options[$thn] = $thn;
					}
					echo form_dropdown('tahun',$options,set_value('tahun'),$atrib);	
                ?>
            </div>
            <?php echo form_error('tahun'); ?>
        </li>

        <li id="id_bulan" display="none">
            <label class="desc">Bulan </label>
                <div>
                    <?php	echo form_dropdown('bulan', $bulan_options, set_value('bulan'),$atrib_bulan); ?>
                </div>
            <?php echo form_error('bulan'); ?>
        </li>		

        <li id="id_divisi" display="none">
            <label class="desc">Divisi </label>
                <div>
                    <?php	echo form_dropdown('divisi', $divisi_options, set_value('divisi'),$atrib_divisi); ?>
                </div>
            <?php echo form_error('divisi'); ?>
        </li>			
		
		<li class="buttons">
		  <input id="submit" type="submit" value="Rekap" />
		  <input id="reset" type="reset" value="Reset" />
		</li>
	</ul>
	
</div>
</fieldset>
<?= form_close(); ?>

<script type="text/javascript" src="<?= base_url() ?>js/chosen.jquery.js"></script>
	<script type="text/javascript">
	$("#jenis_laporan").bind('change',function () 
	{	
	var prp = $("#jenis_laporan").val();

		if(prp=="0"){
	        document.getElementById('id_bulan').style.display='block';
	        document.getElementById('id_divisi').style.display='block';
	    }else {
	        document.getElementById('id_bulan').style.display='none';
	        document.getElementById('id_divisi').style.display='none';
	    }
	}
	);
			$(".chzn-select").chosen({no_results_text: "Data yang dicari tidak ditemukan"});
		</script>

</div><!--container-->